
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

SET(SERVICE_MESSAGE_SRC
    BasicCom.pb.c
    )

add_library(example_service_message SHARED ${SERVICE_MESSAGE_SRC})

INSTALL(TARGETS example_service_message DESTINATION ${PROJECT_INSTALL_PREFIX}/lib )

add_executable(consumer example_consumer.c)
target_link_libraries(consumer somb example_service_message)
INSTALL(TARGETS consumer DESTINATION ${PROJECT_INSTALL_PREFIX}/bin)



add_executable(producer example_producer.c)
target_link_libraries(producer somb example_service_message)
INSTALL(TARGETS producer DESTINATION ${PROJECT_INSTALL_PREFIX}/bin)


add_executable(test1_server test1_server.c)
target_link_libraries(test1_server somb )
INSTALL(TARGETS test1_server DESTINATION ${PROJECT_INSTALL_PREFIX}/bin)

add_executable(test1_client test1_client.c)
target_link_libraries(test1_client somb )
INSTALL(TARGETS test1_client DESTINATION ${PROJECT_INSTALL_PREFIX}/bin)



add_executable(test2_server test2_server.c)
target_link_libraries(test2_server somb )
INSTALL(TARGETS test2_server DESTINATION ${PROJECT_INSTALL_PREFIX}/bin)

add_executable(test2_client1 test2_client.c)
add_executable(test2_client2 test2_client.c)
target_link_libraries(test2_client1 somb )
target_link_libraries(test2_client2 somb )
INSTALL(TARGETS test2_client1 DESTINATION ${PROJECT_INSTALL_PREFIX}/bin)
INSTALL(TARGETS test2_client2 DESTINATION ${PROJECT_INSTALL_PREFIX}/bin)
